package test3;

public class Fibonacci {
	public static int getInput() throws Exception{
		System.out.println("Enter the number: ");
		int buffer = System.in.read();
		return buffer;
	}
	
	public static void main(String[] args)throws Exception{
		int fib = getInput();
		int[] angka = new int[fib];
		angka[0] = 0;
		angka[1] = 1;
		
		for(int i=2 ; i<fib ; i++){
			angka[i] = angka[i-2] + angka[i-1];
			
		}
		for(int i=0 ; i<fib ; i++){
			System.out.print(angka[i] + " ");
		}
	}
}
